<?php
class Zendvn_Filter_AddLink implements Zend_Filter_Interface{
	
	protected $_findwork;
	protected $_link;


	public function __construct($findwork, $link) {
		$this->_findwork = $findwork;
		$this->_link = $link;
	}
	
	public function filter($value) {
		$pattern = '#' . $this->_findwork . '#imsU';
		$replace = '<a href="' . $this->_link . '">' . $this->_findwork . '</a>';
		$valueFilter = preg_replace($pattern, $replace, $value);
		return $valueFilter;
	}
}